<template>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column label="id" prop="id" />
    <el-table-column label="用户名" prop="username" />
    <el-table-column label="个性签名" prop="personalizedSignature" />
    <el-table-column align="right">
      <template #default="scope">
        <el-button size="small" @click="handleEdit(scope.$index, scope.row)"
        >编辑</el-button>
        <el-button
            size="small"
            type="danger"
            @click="handleDelete(scope.$index, scope.row)"
        >删除</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import {ref,reactive, getCurrentInstance, onMounted} from 'vue'
import {reqFindAll,reqUpdateSignature} from "@/api";
import {ElMessage} from "element-plus";
export default {
name: "AdminUser",
  setup(){
    const tableData= ref([])
    const {proxy}=getCurrentInstance()
    const findAll=async ()=>{
     const result=await reqFindAll()
      if (result.status===10000){
        proxy.tableData=result.data
      }else{
        ElMessage.error('系统异常')
      }
    }
    onMounted(()=>{
      findAll()
    })
    const handleEdit = () => {
       proxy.dialogVisible=true
    }
    const handleDelete = () => {

    }
    const dialogVisible = ref(false)
    return{tableData,handleEdit,handleDelete,dialogVisible}
  }
}
</script>

<style scoped>

</style>
